<%@page import="com.ingenio.business.Usuario"%>
<%@page import="com.ingenio.dao.UsuarioAdapter"%>
<%@page import="com.ingenio.business.Producto"%>
<%@page import="com.ingenio.dao.ProductoAdapter"%>
<%@page import="com.ingenio.business.Almacen"%>
<%@page import="com.ingenio.dao.AlmacenAdapter"%>
<%@page import="com.ingenio.business.TipoMovimiento"%>
<%@page import="com.ingenio.dao.TipoMovimientoAdapter"%>
<%@page import="com.ingenio.dao.MarcaAdapter"%>
<%@page import="com.ingenio.business.Marca"%>
<%@page import="com.ingenio.dao.SubRubroAdapter"%>
<%@page import="com.ingenio.business.SubRubro"%>
<%@page import="com.ingenio.dao.RubroAdapter"%>
<%@page import="com.ingenio.business.Rubro"%>
<%@page import="java.util.List"%>
<%@page import="com.ingenio.dao.CategoriaAdapter"%>
<%@page import="com.ingenio.business.Categoria"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Planificaci&oacute;n Recuento Inventario</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

   <!--link rel="stylesheet/less" href="less/bootstrap.less" type="text/css" /-->
   <!--link rel="stylesheet/less" href="less/responsive.less" type="text/css" /-->
   <!--script src="js/less-1.3.3.min.js"></script-->
   <!--append ‘#!watch’ to the browser URL, then refresh the page. -->
	
   <link href="css/bootstrap.min.css" rel="stylesheet">
   <link href="css/pedido.css" rel="stylesheet">
   <link href="css/principal.css" rel="stylesheet">
   <link href="css/datepicker.css" rel="stylesheet">

  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
  <![endif]-->

  <!-- Fav and touch icons -->
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/apple-touch-icon-144-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/apple-touch-icon-72-precomposed.png">
  <link rel="apple-touch-icon-precomposed" href="img/apple-touch-icon-57-precomposed.png">
  <link rel="shortcut icon" href="img/favicon.png">
  
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script type="text/javascript" src="js/bootstrap.min.js"></script>
  <script type="text/javascript" src="js/recuento.js"></script>
  <script type="text/javascript" src="js/notify.min.js"></script>
  <script type="text/javascript" src="js/bootstrap-datepicker.js"></script>
  <script type="text/javascript" src="js/bootstrap-datepicker.es.js"></script>
</head>

<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
          </button>
          <a class="navbar-brand" href="index.jsp">InGenio</a>
        </div>
      </div>
    </nav>
<div class="container container--menu">
	<div class="row clearfix">
	<form action="GenerarRecuento" method="post">
		<div class="col-md-12 column">
			<div class="page-header">
				<h1>Planificaci&oacute;n Recuento de Inventario</h1>
			</div>
			
			<div class="row col-md-10">
			  <div class="form-group">
    			<label for="almacen" class="col-lg-2 control-label">Almacen</label>
    			<div class="col-md-3">
			  		<select class="form-control select select-primary select-block mbl pull-left almacen" id="almacen" name="almacen">
			  			<option value="-1">Almacen</option>	  						
 							<% 
 								AlmacenAdapter aa = new AlmacenAdapter();
	  							List<Almacen> almacenes = aa.devolverTodos();
	  							for(Almacen a: almacenes){
 							%>
  								<option value="<%=a.getIdAlmacen()%>"><%=a.getDescripcion() %></option>
   							<% 
 								}
   							%>
			  		</select>
			  	</div>
			  	<label for="fechaRecuento" class="col-lg-2 control-label">Fecha Recuento</label>
    			<div class="col-md-3">
				  <div class="input-group input-append date">
               <input type="text" class="form-control uneditable-input" id="fechaRecuento" name="fechaRecuento"/>
               <span class="input-group-addon fechaRecuento"><span class="glyphicon glyphicon-calendar"></span>
               </span>
            </div>
                  </div>
			  	</div>	
  			  </div>
  			</div>
  			<div class="clear form-group"></div>  
  			<div class="row col-md-10">
  			  <div class="form-group">
    			<label for="encargadoAlm" class="col-lg-2 control-label">Encargado</label>
    			<div class="col-md-3">
			  		<select class="form-control select select-primary select-block mbl pull-left encargadoAlm" id="encargadoAlm" name="encargadoAlm">
			  			<option value="-1">Encargado</option>
			  				<% 
			  					//Hacer que traiga verdaderamente a los encargados
			  					UsuarioAdapter ua = new UsuarioAdapter();
		    					List<Usuario> encargados = ua.devolverTodos();
		    					for(Usuario u: encargados){
 							%>
  								<option value="<%=u.getIdUsuario()%>"><%=u.getNombreUsu() +" "+ u.getApellidoUsu() %></option>
   							<% 
 								}
   							%>
			  		</select>
			  	</div>
			  	<label for="almacen" class="col-lg-3 control-label">Bloquea inventario</label>
    			<div class="col-md-2">
			  		<input type="checkbox" class="chkBloqueaInv pull-left" id="chkBloqueaInv" name="chkBloqueaInv">
			  	</div>
  			  </div>
  			</div>
  			<div class="clear form-group"></div>  
  			<div class="row col-md-12">
  			<fieldset class="scheduler-border">
  			<div>
  			<legend>Filtrar Productos <button type="button" class="btn btn-primary search pull-right glyphicon glyphicon-search filtrarProd" id="filtrarProd" name="filtrarProd"></button></legend>
  			</div>
  				<div class="form-group">
    				<label for="cbxCategoria" class="col-lg-1 control-label">Categoria</label>
    				<div class="col-md-2">
			  			<select class="form-control select select-primary select-block mbl pull-left cbxCategoria" id="cbxCategoria" name="cbxCategoria">
			  				<option value="Categoria">Categoria</option>
			  					<% 
			  					CategoriaAdapter ca = new CategoriaAdapter();
	    						List<Categoria> categorias = ca.devolverTodos();
	    						for(Categoria c: categorias){
 								%>
  									<option value="<%=c.getIdCategoria()%>"><%=c.getDescCategoria() %></option>
   								<% 
 								}
   								%>
			  			</select>
			  		</div>
			  		<label for="cbxRubro" class="col-lg-1 control-label">Rubro</label>
    				<div class="col-md-2">
			  			<select class="form-control select select-primary select-block mbl pull-left cbxRubro" id="cbxRubro" name="cbxRubro">
			  				<option value="Rubro">Rubro</option>
			  					<%
			  					RubroAdapter ra = new RubroAdapter();
				  				List<Rubro> rubros = ra.devolverTodos();
				  				for(Rubro r: rubros){
 								%>
  									<option value="<%=r.getIdRubro()%>"><%=r.getDescRubro() %></option>
   								<% 
 								}
   								%>
			  			</select>
			  		</div>
			  		<label for="cbxSubRubro" class="col-lg-1 control-label">SubRubro</label>
    				<div class="col-md-2">
			  			<select class="form-control select select-primary select-block mbl pull-left cbxSubRubro" id="cbxSubRubro" name="cbxSubRubro">
			  				<option value="SubRubro">SubRubro</option>
			  					<%
			  					SubRubroAdapter sra = new SubRubroAdapter();
				  				List<SubRubro> subrubros = sra.devolverTodos();
				  				for(SubRubro sr: subrubros){
 								%>
  									<option value="<%=sr.getIdSubRubro()%>"><%=sr.getDecSubRubro() %></option>
   								<% 
 								}
   								%>
			  			</select>
			  		</div>
			  		<label for="cbxMarca" class="col-lg-1 control-label">Marca</label>
    				<div class="col-md-2">
			  			<select class="form-control select select-primary select-block mbl pull-left cbxMarca" id="cbxMarca" name="cbxMarca">
			  				<option value="Marca">Marca</option>
			  					<%
			  					MarcaAdapter ma = new MarcaAdapter();
				  				List<Marca> marcas = ma.devolverTodos();
				  				for(Marca m: marcas){
 								%>
  									<option value="<%=m.getIDMarca()%>"><%=m.getDescMarca() %></option>
   								<% 
 								}
   								%>
			  			</select>
			  		</div>
  			  	</div></fieldset>  
  			</div>  
  			<div class="clear p-bottom"></div>
			<div class="clear p-bottom"></div>
			<div class="clear p-bottom"></div>
            <div class="todo">
            	<div class="col-md-12">
            		<div class="form-group">
            			<div class="col-md-6 left">
							<table class="table table-striped table-fixedheader prodTodos pull-left">
							    <thead>
									<tr>
										<th width="32%">C&oacute;digo</th>
										<th width="55%">Descripci&oacute;n</th>
										<th width="13%">&nbsp;</th>
									</tr>
								</thead>
								<tbody style="height:200px">
								   <%
								   		ProductoAdapter pa = new ProductoAdapter();
									   List<Producto> productos = pa.devolverProductos();
									   for(Producto p: productos){
								   %>
								   		<tr>
										    <td width="32%"><%=p.getIdProducto() %></td>
										    <td width="55%"><%=p.getDescProducto() %></td>
										    <td width="13%"><a href="#" class="btn btn-inverse"><i class="glyphicon glyphicon-arrow-right pasarProd"></i></a ></td>
										</tr>
									<%
									   }
									%>
								</tbody>
							</table>
						</div>
						<div class="col-md-6 right">
							<table class="table table-striped table-fixedheader prodElegidos pull-right">
							    <thead>
									<tr>
										<th width="13%">&nbsp;</th>
										<th width="32%">C&oacute;digo</th>
										<th width="55%">Descripci&oacute;n</th>
									</tr>
								</thead>
								<tbody style="height:200px">
								   <!-- <tr>
								    <td width="13%"><a href="#" class="btn btn-inverse"><i class="glyphicon glyphicon-arrow-left volverProd"></i></a ></td>
								    <td width="32%"></td>
								    <td width="55%"></td>
								  </tr> -->
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
			<div class="clear"></div>
			
			<div class="">
				
				<div class="right">
					 <button type="submit" class="btn btn-primary confirm btnConfirmar">Confirmar</button>
					 <button type="button" class="btn btn-primary cancel">Cancelar</button>
				</div>
			</div>
			
			<div class="clear"></div>
			</form>
		</div>
	</div>
</body>
</html>